Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ashton/relibc
  • vincent/relibc
  • 4lDO2/relibc
  • boomshroom/relibc
  • njskalski/relibc
  • bjorn3/relibc
  • microcolonel/relibc
  • gmacd/relibc
  • feliwir/relibc
  • devnexen/relibc
  • jamesgraves/relibc
  • oddcoder/relibc
  • andar1an/relibc
  • gugz0r/relibc
  • matijaskala/relibc
  • zen3ger/relibc
  • josh/relibc
  • redox-os/relibc
  • Majoneza/relibc
  • enygmator/relibc
  • JustAnotherDev/relibc
  • doriancodes/relibc
  • adamantinum/relibc
  • wiredtv/relibc
  • stratact/relibc
  • Ramla-I/relibc
  • martin/relibc
  • bitstr0m/relibc
  • henritel/relibc
  • smckay/relibc
  • xTibor/relibc
  • devajithvs/relibc
  • andypython/relibc
  • t-nil/relibc
  • DataTriny/relibc
  • ids1024/relibc
  • SteveLauC/relibc
  • dlrobertson/relibc
  • AgostonSzepessy/relibc
  • TheDarkula/relibc
  • willnode/relibc
  • bamontan/relibc
  • redoxeon/relibc
  • ayf/relibc
  • heghe/relibc
  • Ivan/relibc
  • hasheddan/relibc
  • dahc/relibc
  • auwardoctor/relibc
  • kodicraft/relibc
  • arthurpaulino/relibc
  • jasonhansel/relibc
  • bpisch/relibc
  • kel/relibc
  • GrayJack/relibc
  • darley/relibc
  • sahitpj/relibc
  • plimkilde/relibc
  • BjornTheProgrammer/relibc
  • defra/relibc
  • Schyrsivochter/relibc
  • ebalalic/relibc
  • adchacon/relibc
  • aaronjanse/relibc
  • josh_williams/relibc
  • 8tab/relibc
  • nicoan/relibc
  • athei/relibc
  • carrot93/relibc
  • RA_GM1/relibc
  • zhaozhao/relibc
  • JCake/relibc
  • KGrewal1/relibc
  • emturner/relibc
  • LuigiPiucco/relibc
  • bfrascher/relibc
  • starsheriff/relibc
  • kcired/relibc
  • jamespcfrancis/relibc
  • neallred/relibc
  • omar-mohamed-khallaf/relibc
  • jD91mZM2/relibc
  • rw_van/relibc
  • Skallwar/relibc
  • matt-vdv/relibc
  • mati865/relibc
  • SoyaOhnishi/relibc
  • ArniDagur/relibc
  • tlam/relibc
  • glongo/relibc
  • kamirr/relibc
  • abdullah/relibc
  • saeedtabrizi/relibc
  • sajattack/relibc
  • lmiskiew/relibc
  • seanpk/relibc
  • MaikuZ/relibc
  • jamadazi/relibc
  • coolreader18/relibc
  • wt/relibc
  • lebensterben/relibc
  • uuuvn/relibc
  • vadorovsky/relibc
  • raffaeleragni/relibc
  • freewilll/relibc
  • LLeny/relibc
  • alfredoyang/relibc
  • batonius/relibc
  • TornaxO7/relibc
  • Arcterus/relibc
  • Tommoa/relibc
  • samuela/relibc
  • mindriot101/relibc
  • lygstate/relibc
114 results
Show changes
......@@ -69,10 +69,10 @@ unsafe fn parse_arg(
let print_error = |desc: &[u8]| {
// NOTE: we don't use fprintf to get around the usage of va_list
stdio::fputs(*argv as _, &mut *stdio::stderr);
stdio::fputs(desc.as_ptr() as _, &mut *stdio::stderr);
stdio::fputc(*current_arg as _, &mut *stdio::stderr);
stdio::fputc(b'\n' as _, &mut *stdio::stderr);
stdio::fputs(*argv as _, &mut *stdio::__stderr());
stdio::fputs(desc.as_ptr() as _, &mut *stdio::__stderr());
stdio::fputc(*current_arg as _, &mut *stdio::__stderr());
stdio::fputc(b'\n' as _, &mut *stdio::__stderr());
};
match find_option(*current_arg, optstring) {
......
......@@ -17,20 +17,23 @@
/getid
/getc_unget
/link
/locale
/math
/mem
/pipe
/printf
/rmdir
/rename
/scanf
/setid
/setid
/setjmp
/sleep
/sprintf
/stdlib/a64l
/stdlib/bsearch
/stdlib/rand
/stdlib/strtol
/stdlib/strtoul
/stdlib/a64l
/stdio/fwrite
/stdio/all
......@@ -49,3 +52,5 @@
/waitpid
/write
/time
/gmtime
/asctime
......@@ -15,12 +15,15 @@ EXPECT_BINS=\
getid \
getc_unget \
link \
locale \
math \
mem \
pipe \
printf \
rename \
rmdir \
scanf \
setjmp \
sleep \
sprintf \
stdio/fwrite \
......@@ -28,6 +31,7 @@ EXPECT_BINS=\
stdio/freopen \
stdlib/bsearch \
stdlib/strtol \
stdlib/strtoul \
stdlib/a64l \
stdlib/rand \
string/strncmp \
......@@ -43,7 +47,9 @@ EXPECT_BINS=\
unlink \
waitpid \
write \
time
time \
gmtime \
asctime
# Binaries that may generate varied output
BINS=\
......
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
time_t a = 0;
tm *time_info = gmtime(&a);
char *time_string = asctime(time_info);
if (time_string == NULL || strcmp(time_string, "Thu Jan 1 00:00:00 1970\n") != 0) {
exit(1);
}
return 0;
}
success!
success!
jumping...
hi from jump
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
time_t a = 0;
tm expected = { .tm_sec = 0, .tm_min = 0, .tm_hour = 0, .tm_mday = 1, .tm_year = 70,
.tm_wday = 4, .tm_yday = 0, .tm_isdst = 0, .tm_gmtoff = 0, .tm_zone = "UTC" };
tm *info = gmtime(&a);
if (info->tm_sec != expected.tm_sec || info->tm_min != expected.tm_min ||
info->tm_hour != expected.tm_hour || info->tm_mday != expected.tm_mday ||
info->tm_year != expected.tm_year || info->tm_wday != expected.tm_wday ||
info->tm_yday != expected.tm_yday || info->tm_isdst != expected.tm_isdst ||
info->tm_gmtoff != expected.tm_gmtoff || strcmp(info->tm_zone, expected.tm_zone) != 0) {
exit(1);
}
if (info->tm_sec != expected.tm_sec || info->tm_min != expected.tm_min ||
info->tm_hour != expected.tm_hour || info->tm_mday != expected.tm_mday ||
info->tm_year != expected.tm_year || info->tm_wday != expected.tm_wday ||
info->tm_yday != expected.tm_yday || info->tm_isdst != expected.tm_isdst ||
info->tm_gmtoff != expected.tm_gmtoff || strcmp(info->tm_zone, expected.tm_zone) != 0) {
exit(1);
}
return 0;
}
#include <locale.h>
#include <stdio.h>
#include <string.h>
int main() {
// TODO: Implement locale properly and test it here
char* val = setlocale(LC_ALL, NULL);
if (strcmp(val, "C") == 0) {
puts("success!");
} else {
printf("setlocale returned the wrong value: %s", val);
}
}
......@@ -2,9 +2,10 @@
int main(int argc, char ** argv) {
printf(
"percent: %%\nstring: %s\nchar: %c\nint: %d\nuint: %u\nhex: %x\nHEX: %X\nstring: %s\n",
"percent: %%\nstring: %s\nchar: %c\nchar: %c\nint: %d\nuint: %u\nhex: %x\nHEX: %X\nstring: %s\n",
"String",
'c',
254,
-16,
32,
0xbeef,
......
......@@ -3,22 +3,22 @@
#include <string.h>
#include <unistd.h>
static char old[] = "old-name.out";
static char new[] = "new-name.out";
static char oldpath[] = "old-name.out";
static char newpath[] = "new-name.out";
static char str[] = "Hello, World!";
int str_len = 13;
int main() {
char buf[14];
buf[13] = 0x00;
int fd = creat(old, 0777);
int fd = creat(oldpath, 0777);
write(fd, str, str_len);
close(fd);
rename(old, new);
fd = open(new, O_RDONLY);
rename(oldpath, newpath);
fd = open(newpath, O_RDONLY);
read(fd, buf, str_len);
close(fd);
remove(new);
remove(newpath);
if (strcmp(str, buf) == 0) {
return 0;
} else {
......
#include <stdio.h>
int main(int argc, char ** argv) {
int a = 0;
int b = 0;
int val = sscanf("123 0x321", "%d %i", &a, &b);
if (val != 2) {
printf("error: %d\n", val);
} else {
if (a == 123 && b == 0x321) {
puts("success!");
} else {
printf("incorrect results: { a: %d, b: %x }\n", a, b);
}
}
}
#include <stdio.h>
#include <setjmp.h>
int main() {
jmp_buf buf;
if (setjmp(buf)) {
puts("hi from jump");
} else {
puts("jumping...");
longjmp(buf, 0);
}
}
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
printf("%ld\n", strtoul(" -42", NULL, 0));
printf("%ld\n", strtoul(" +555", NULL, 0));
printf("%ld\n", strtoul(" 1234567890 ", NULL, 0));
printf("%ld\n", strtoul(" -42", NULL, 10));
printf("%ld\n", strtoul(" +555", NULL, 10));
printf("%ld\n", strtoul(" 1234567890 ", NULL, 10));
printf("%lx\n", strtoul(" 0x38Acfg", NULL, 0));
printf("%lx\n", strtoul("0Xabcdef12", NULL, 16));
printf("%lo\n", strtoul(" 073189", NULL, 0));
printf("%lo\n", strtoul(" 073189", NULL, 8));
printf("%lo\n", strtoul(" 0b", NULL, 8));
if(errno != 0) {
printf("errno is not 0 (%d), something went wrong\n", errno);
}
printf("%lo\n", strtoul(" 0b", NULL, 0));
if(errno != 0) {
printf("errno is not 0 (%d), something went wrong\n", errno);
}
return 0;
}
......@@ -7,5 +7,7 @@ int main(int argc, char** argv) {
perror("clock_gettime");
time(NULL);
perror("time");
clock_t c = clock();
perror("clock");
return 0;
}
Subproject commit ba5a07a744915b501acadb17e05db0f5d6552f72
Subproject commit 1e7a8b6b6f8171caab6c8c531ee9f1983bc2ebe0