PandA-2024.02
module.c
Go to the documentation of this file.
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <assert.h>
4 #include <fcntl.h>
5 #include <unistd.h>
6 
7 int check_printf(int a)
8 {
9  int id = open("test.xml", O_RDONLY);
10  assert(id != -1);
11  int id_write = open("test_copied.xml", O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
12  assert(id_write != -1);
13  ssize_t res;
14  char buffer[256];
15  int index, res_index;
16  for(index=0; index<256; ++index)
17  buffer[index]=0;
18  printf("check %d\n", id);
19  printf("check_write %d\n", id_write);
20  res = read(id, buffer, 256);
21  printf("res %d\n", res);
22  for(index=0; index<res; ++index)
23  printf("%c", buffer[index]);
24  printf("\n");
25 
26  res_index = write(id_write, buffer, res);
27  printf("n. bytes read=%d, n. bytes written=%d\n", res, res_index);
28  close(id);
29  close(id_write);
30  return a;
31 }
#define index(x, y)
Definition: Keccak.c:74
int check_printf(int a)
Definition: module.c:7
short int read(short int *data)
Definition: read.c:3

Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by doxygen 1.8.13