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:
+12
-1
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user