diff options
author | maxim <maxim@FreeBSD.org> | 2006-05-29 10:56:27 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2006-05-29 10:56:27 +0000 |
commit | 885f3862760d70541ff5b01d8754688ceec6eff0 (patch) | |
tree | 1fcfb30d7c922be27b8b7359b8ced4941ac86646 /tools | |
parent | 4676c61f8331ab74da5ca938d02d45c6771ddcd1 (diff) | |
download | FreeBSD-src-885f3862760d70541ff5b01d8754688ceec6eff0.zip FreeBSD-src-885f3862760d70541ff5b01d8754688ceec6eff0.tar.gz |
o Test truncate(2) on fifo: it should ignore the request and
return success.
PR: kern/98064
Submitted by: Kirk Russell
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/fifo/fifo_misc/fifo_misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/regression/fifo/fifo_misc/fifo_misc.c b/tools/regression/fifo/fifo_misc/fifo_misc.c index 6ae340e..b379d18 100644 --- a/tools/regression/fifo/fifo_misc/fifo_misc.c +++ b/tools/regression/fifo/fifo_misc/fifo_misc.c @@ -130,6 +130,24 @@ test_lseek(void) cleanfifo("testfifo", reader_fd, writer_fd); } +/* + * truncate(2) on FIFO should silently return success. + */ +static void +test_truncate(void) +{ + + makefifo("testfifo", __func__); + + if (truncate("testfifo", 1024) != 0) { + warn("%s: truncate", __func__); + cleanfifo("testfifo", -1, -1); + exit(-1); + } + + cleanfifo("testfifo", -1, -1); +} + struct filter_entry { int fe_filter; const char *fe_name; @@ -326,6 +344,7 @@ main(int argc, char *argv[]) err(-1, "chdir %s", temp_dir); test_lseek(); + test_truncate(); test_kqueue(); test_ioctl(); |