Last active
January 12, 2023 16:36
-
-
Save davisp/767a5812195c0934a12ec39f6826dc34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ foo.cc | |
./a.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <iostream> | |
int | |
main(int, char* []) | |
{ | |
char* buf = nullptr; | |
int fd = open("blargh.txt", O_WRONLY | O_APPEND | O_CREAT, 755); | |
ssize_t written = pwrite(fd, 0x0, 2147483647, 0); | |
std::cerr << "Wrote: " << written << std::endl; | |
std::cerr << strerror(errno) << std::endl; | |
} |
leipzig
commented
Jan 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment