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