diff options
| author | Toby Goodwin <tjg@star.le.ac.uk> | 2001-10-31 12:31:57 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:22:10 +0100 |
| commit | 2ef8a59ae61b83ad2ba9d4c9381eead5ae403cb0 (patch) | |
| tree | 344894ce750ae1ca4b4893bd7dda2fbeb27eb6e7 /tripping.c | |
| parent | 609a278bf6e301ea9a021793de314ddcadb806ba (diff) | |
candidate: rc-1.6c4
Diffstat (limited to 'tripping.c')
| -rw-r--r-- | tripping.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1,7 +1,12 @@ /* This is an auxiliary test program for rc. */ +#include "config.h" + #include <fcntl.h> #include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <unistd.h> static void out0(void) { putchar('t'); putchar('r'); @@ -14,6 +19,21 @@ static void ctrl_a(void) { puts("a\001ab\002b"); } +static void large(void) { + char c = 'c'; + +#define LARGE (((off_t)1<<33)+1) + + if (lseek(1, LARGE, SEEK_SET) != LARGE) { + perror("lseek"); + exit(1); + } + if (write(1, &c, 1) == -1) { + perror("write"); + exit(1); + } +} + static void makenonblock(void) { int flags; @@ -32,6 +52,9 @@ int main(int argc, char **argv) { case 'a': ctrl_a(); break; + case 'l': + large(); + break; case 'n': makenonblock(); break; |