Suppose a function that does the following, assuming all operations can fail and none can block:
- Allocate XXX bytes of memory (on the heap)
- Open file for reading
- Read file into allocated buffer
- Acquire lock
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <net/if.h> | |
#include <netdb.h> | |
-------- START OF LOG -------- | |
17:02:16 LOG: Core version: $Version: Talos_PC_distro; Talos_Executables-OSX-Final; 300763 2017-04-13 14:14:40 @builderm04.croteam.local; OSX-x86-Static-Final-Default$ | |
17:02:16 LOG: Command: $ | |
17:02:16 LOG: Initializing timer. | |
17:02:16 LOG: Timestamp: 2017/04/16 17:02:16 | |
17:02:16 LOG: Binary name: Talos | |
17:02:16 LOG: Binary soft path: Bin/ |
# Set environment for Go development. Inspired by Python virtualenv | |
# This file must be used with "source activate_goenv.sh" *from bash* | |
# you cannot run it directly | |
deactivate () { | |
# reset old environment variables | |
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all | |
if ! [ -z "${_OLD_GOENV_GOPATH+_}" ] ; then | |
GOPATH="$_OLD_GOENV_GOPATH" |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/sysctl.h> | |
int main(int argc, char** argv) { | |
int mib[3], argmax; | |
size_t syssize; | |
char *procargs, *cp, *thiscmd; |
/* | |
FUSE: Filesystem in Userspace | |
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> | |
This program can be distributed under the terms of the GNU GPL. | |
See the file COPYING. | |
*/ | |
/* |
// | |
// fs_capabilities.m | |
// | |
// Created by Charles Francoise on 13/05/14. | |
// Copyright (c) 2014 Charles Francoise. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <errno.h> |
ln -s /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash /usr/local/etc/bash_completion.d/git |
ln -s /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash /usr/local/etc/bash_completion.d/git |