errors in compiling with galileo but successful with wrduino

this is code

//made by Abhay Gupta

#define resolution 8
#define mains 50

#define refresh 2 * 1000000 / mains

void setup() {
Serial.begin(115200);

// unused pins are fairly insignificant,
// but pulled low to reduce unknown variables
for(int i = 2; i < 14; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}

for(int i = 8; i < 11; i++)
pinMode(i, INPUT);

startTimer();
}

void loop() {
Serial.print(time(8, B00000001), DEC);
Serial.print(" “);
Serial.print(time(9, B00000010), DEC);
Serial.print(” ");
Serial.println(time(10, B00000100), DEC);

}

long time(int pin, byte mask) {
unsigned long count = 0, total = 0;
while(checkTimer() < refresh) {
// pinMode is about 6 times slower than assigning
// DDRB directly, but that pause is important
pinMode(pin, OUTPUT);
PORTB = 0;
pinMode(pin, INPUT);
while((PINB & mask) == 0)
count++;
total++;
}
startTimer();
return (count << resolution) / total;
}

extern volatile unsigned long timer0_overflow_count;

void startTimer() {
timer0_overflow_count = 0;
TCNT0 = 0;
}

unsigned long checkTimer() {
return ((timer0_overflow_count << 8) + TCNT0) << 2;
}

these are the errors

_3d.ino: In function ‘long int time(int, byte)’:
_3d.ino:39:5: error: ‘PORTB’ was not declared in this scope
_3d.ino:41:12: error: ‘PINB’ was not declared in this scope
_3d.ino: In function ‘void startTimer()’:
_3d.ino:53:3: error: ‘TCNT0’ was not declared in this scope
_3d.ino: In function ‘long unsigned int checkTimer()’:
_3d.ino:57:42: error: ‘TCNT0’ was not declared in this scope
Error compiling.

plz help

Does galileo support arduino?
I just recall that edison arduino.

Take reference from edison, the arduino looks like a specific package which needs to be enabled.
In default, we will have a linux system on it