diff options
Diffstat (limited to 'testsuite/systemtap.syscall/trunc.c')
-rw-r--r-- | testsuite/systemtap.syscall/trunc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/systemtap.syscall/trunc.c b/testsuite/systemtap.syscall/trunc.c new file mode 100644 index 00000000..ff20cb39 --- /dev/null +++ b/testsuite/systemtap.syscall/trunc.c @@ -0,0 +1,23 @@ +/* COVERAGE: ftruncate truncate */ + +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + + +int main() +{ + int fd; + + + fd = creat("foobar",S_IREAD|S_IWRITE); + ftruncate(fd, 1024); + // ftruncate (4, 1024) = 0 + close(fd); + + truncate("foobar", 2048); + // truncate ("foobar", 2048) = 0 + + return 0; +} |