Home | History | Annotate | Download | only in tests
      1 #include <fcntl.h>
      2 #include <stdio.h>
      3 #include <stdlib.h>
      4 #include <unistd.h>
      5 int main ( void )
      6 {
      7    char* arr = malloc(10);
      8    int fd = open("/dev/null", O_WRONLY);
      9    if (fd < 0) {
     10       fprintf(stderr, "open failed\n");
     11    } else {
     12       (void)write(fd, arr, 10);
     13       (void)close(fd);
     14    }
     15 
     16    return 0;
     17 }
     18