diff options
| author | tjg <tjg> | 2001-10-31 12:30:00 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:20 +0100 |
| commit | aea9f2fdebb7daf2c0b16af9430bb05a07ab86b1 (patch) | |
| tree | a9f311aeb846c8872ba9186db6a30f9431a989cd /tripping.c | |
| parent | dca1eabff1b5fd37367a5921153c51a694063bcb (diff) | |
Feature: large file support (thanks Scott Schwartz, Chris
Siebenmann).
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; |