7 #include "../Sysfs/Sysfs.h"
24 fd = open(
"/sys/class/gpio/unexport", O_WRONLY);
27 fprintf(stderr,
"201309202231 Failed to open unexport for writing, are you root?\n");
31 BytesToWrite = snprintf(buffer,
BUFFER_MAX,
"%d", Pin);
32 BytesWritten = write(fd, buffer, BytesToWrite);
34 if( BytesWritten != BytesToWrite )
36 fprintf( stderr,
"201309210100 Encountered short write\n" );
37 fprintf( stderr,
"201309231033 BytesToWrite was %i, BytesWritten was %i\n", (
int)BytesToWrite, (
int)BytesWritten );