debian seems to have a newlib without reent :(
ROMEO CI Builder / Build Code (push) Failing after 1m43s

This commit is contained in:
2025-11-14 17:27:56 +01:00
parent 081c3a7472
commit c111ec176c
3 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ int hw_device_open(const char *path, size_t path_len) {
return UART_1;
}
_REENT_ERRNO(_REENT) = ENOENT;
// _REENT_ERRNO(_REENT) = ENOENT;
return -1;
}
@@ -70,7 +70,7 @@ int hw_interface_write(int fd, const char *ptr, size_t len) {
uart_send(XPS_UART1_BASEADDR, ptr, len);
return len;
}
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
@@ -83,4 +83,4 @@ int hw_interface_read(int fd, char *ptr, size_t len) {
return uart1_read(ptr,len);;
}
return -1;
}
}
+7 -7
View File
@@ -10,19 +10,19 @@
int read(int fd, void *ptr, size_t len) {
if (ptr == NULL) {
_REENT_ERRNO(_REENT) = EINVAL;
// _REENT_ERRNO(_REENT) = EINVAL;
return -1;
}
// 0 is stdin, TODO: do we support it?
if (fd < 1) {
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
// stdout and stderr
if (fd < 3) {
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
@@ -30,13 +30,13 @@ int read(int fd, void *ptr, size_t len) {
int result = hw_interface_read(fd, ptr, len);
if (result >= 0) {
return result;
} else if (_REENT_ERRNO(_REENT) != EBADF) {
return result;
// } else if (_REENT_ERRNO(_REENT) != EBADF) {
// return result;
}
// continue if fd did not match to try other fd providers
}
// we do not have dynamic fds, so fd is invalid
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
}
+6 -6
View File
@@ -10,14 +10,14 @@
int write(int fd, const void *ptr, size_t len) {
if (ptr == NULL) {
_REENT_ERRNO(_REENT) = EINVAL;
// _REENT_ERRNO(_REENT) = EINVAL;
return -1;
}
//TODO check len
// 0 is stdin, do not write to it
if (fd < 1) {
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
// we only support a single debug UART, so
@@ -38,13 +38,13 @@ int write(int fd, const void *ptr, size_t len) {
int result = hw_interface_write(fd, ptr, len);
if (result >= 0) {
return result;
} else if (_REENT_ERRNO(_REENT) != EBADF) {
return result;
// } else if (_REENT_ERRNO(_REENT) != EBADF) {
// return result;
}
// continue if fd did not match to try other fd providers
}
// we do not have dynamic fds, so fd is invalid
_REENT_ERRNO(_REENT) = EBADF;
// _REENT_ERRNO(_REENT) = EBADF;
return -1;
}
}