-
-
Notifications
You must be signed in to change notification settings - Fork 698
Add imaxdiv, wcscoll, getdtablesize #639
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
Conversation
26719d0
to
601cdf0
Compare
Fixed for contributing guidelines |
601cdf0
to
20214b7
Compare
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.
Thanks for sending this. Some review comments.
libc/calls/getdtablesize.c
Outdated
*/ | ||
int getdtablesize(void) { | ||
// glibc says the result on WinXP is 2048 | ||
return 2048; |
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.
Cool I didn't know about this function. The right thing to do here with cosmo is return g_fds.n
.
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.
Oh nice, I didn't know about g_fds.n
, should be good now.
test/libc/fmt/imaxdiv_test.c
Outdated
EXPECT_EQ(0, res.quot); | ||
EXPECT_EQ(0, res.rem); | ||
|
||
res = imaxdiv(INT64_MIN, -1); |
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.
INTMAX_MAX
- Why isn't this raising an arithmetic exception? It should.
int main(int argc, char *argv[]) {
volatile intmax_t i, j;
i = INTMAX_MIN;
j = -1;
i = i / j;
return 0;
}
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.
Scratch that. According to GitHub Actions, it does raise SIGFPE. Good.
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.
Oops I meant not to overflow, I fixed the test
Just call wcscoll_l with tls locale
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.
Looks good. Thank you so much!
Co-authored-by: Hugues Morisset <[email protected]>
Some added function implementation that are missing when compiling bash