Fix wrong argument of write. Fix return type of getdents. Fix procfs_getdents. Finish implementing the base version of the ps command.

This commit is contained in:
Enrico Fraccaroli (Galfurian)
2023-01-27 11:38:40 -05:00
parent e926850ce3
commit 59d9bcb596
15 changed files with 133 additions and 93 deletions
+12 -1
View File
@@ -9,13 +9,14 @@
#include "string.h"
#include "stdbool.h"
#include "sys/unistd.h"
#include "strerror.h"
void putchar(int character)
{
write(STDOUT_FILENO, &character, 1);
}
void puts(char *str)
void puts(const char *str)
{
write(STDOUT_FILENO, str, strlen(str));
}
@@ -206,3 +207,13 @@ char *fgets(char *buf, int n, int fd)
return NULL;
return (p);
}
void perror(const char *s)
{
if (s) {
puts(s);
putchar(':');
putchar(' ');
}
puts(strerror(errno));
}