fwrite.c revision e739ac0589b4fb43561f801c4faba8c1b89f8680
1#include <fcntl.h> 2#include <stdio.h> 3#include <stdlib.h> 4#include <unistd.h> 5int 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