"C" code on YUN to hardware reset the Arduino

Hello,

I need to be able to hardware reset the Arduino from C code running in the YUN without using the bridge.

I looked at the schematic and there is a reset I/O line going from the YUN to the arduino reset pin.

Anybody knows any C code that uses that pin to hardware reset the Arduino from the YUN without using the bridge?

Thanks

UPDATE:

I saw this post

#!/bin/sh

echo 18 > /sys/class/gpio/export
echo "high" > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
echo 0 > /sys/class/gpio/gpio18/value
echo 18 > /sys/class/gpio/unexport

But strangely my YUN board does not have /sys/class/gpio/gpio18

Here is my directory listing

root@Arduino:/sys/class/gpio# ls
export gpio21 gpio22 gpio23 gpiochip0 unexport
root@Arduino:/sys/class/gpio#

There is no gpio18 in there, why is it I dont have that gpio defined?

Thanks

root@Arduino:/sys/class/gpio# echo 18 > /sys/class/gpio/export
root@Arduino:/sys/class/gpio# ls
export     gpio18     gpio21     gpio22     gpio23     gpiochip0  unexport
root@Arduino:/sys/class/gpio# echo 18 > /sys/class/gpio/unexport
root@Arduino:/sys/class/gpio# ls
export     gpio21     gpio22     gpio23     gpiochip0  unexport

rouch_neck:
But strangely my YUN board does not have /sys/class/gpio/gpio18

As sonnyyu is demonstrating, the first line of code you listed (echo 18 > /sys/class/gpio/export) creates the /sys/class/gpio/gpio18 device.

You can do it all in C, but that means opening up a bunch of different devices (export, gpio18/direction, etc.) Since all of those commands are already in an existing script file, it's probably easiest to just invoke that script file rather than try to translate it all into C. For example:

 system("reset-mcu");