Загрузить файлы в «src»

This commit is contained in:
8nlight 2023-10-03 23:09:41 +03:00
parent acd5298cb4
commit 266e932fd6
2 changed files with 27 additions and 0 deletions

3
src/true.c Normal file
View File

@ -0,0 +1,3 @@
int main(void) {
return 0;
}

24
src/yes.c Normal file
View File

@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
void print(const char *buf, ssize_t len) {
if (write(STDOUT_FILENO, buf, len) < 0)
exit(1);
}
int main(const int argc, const char **argv) {
if (argc == 1)
while (1)
print("y\n", 2);
while (1) {
for (ssize_t i = 1; i < argc; i++) {
print(argv[i], strlen(argv[i]));
print(" ", 1);
}
print("\n", 1);
}
}