diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-15 02:01:33 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-15 02:01:59 +0100 |
| commit | 3b3325f761b09ebbfef04c44eed546cc4fdeb329 (patch) | |
| tree | aa19ea259bcda2410c2b3dd4512f19fb85aeaf8f /bin/yes/yes.c | |
| parent | 15d2df7811ef3cb79cc3e501d0d5f9b993d42bea (diff) | |
Added aio and eventfd support, along with sleep and yes utilities
Diffstat (limited to 'bin/yes/yes.c')
| -rw-r--r-- | bin/yes/yes.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/yes/yes.c b/bin/yes/yes.c new file mode 100644 index 00000000..0ddb2da1 --- /dev/null +++ b/bin/yes/yes.c @@ -0,0 +1,22 @@ +#include <string.h> +#include <sys/uio.h> + +int main(int argc, char **argv) +{ + char *str; + struct iovec iov[2]; + + str = (argc > 1) ? argv[1] : "y"; + + iov[0].iov_base = str; + iov[0].iov_len = strlen(str); + + iov[1].iov_base = "\n"; + iov[1].iov_len = 1; + + while (1) { + writev(1, iov, 2); + } + + return 0; +} |
