Skip to content

Instantly share code, notes, and snippets.

@Cyberax
Created November 17, 2019 07:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Cyberax/0d296ba1484081cfc60619b805f5c5d8 to your computer and use it in GitHub Desktop.
ShitCodeCPP
const FileDescriptorOwner cgroup_procs_fd(open_appendexisting_at(AT_FDCWD, (current + "/cgroup.procs").c_str()));
if (0 > cgroup_procs_fd.get()) {
procs_file_error:
const int error(errno);
std::fprintf(stderr, "%s: FATAL: %s%s: %s\n", prog, current.c_str(), "/cgroup.procs", std::strerror(error));
throw EXIT_FAILURE;
}
if (0 > write(cgroup_procs_fd.get(), "0\n", 2)) goto procs_file_error;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment