summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/trunc.c
blob: ef2b0c683962fd091aeebdb280e435ead827ad16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
  //staptest// ftruncate (NNNN, 1024) = 0
  close(fd);

  truncate("foobar", 2048);
  //staptest// truncate ("foobar", 2048) = 0

  return 0;
}