Return Values

Returns the result of the C call.

Examples

Example #1 Setting and clearing a lock

<?php

$fd = dio_open('/dev/ttyS0', O_RDWR);

if (dio_fcntl($fd, F_SETLK, Array("type"=>F_WRLCK)) == -1) {// the file descriptor appears lockedecho "The lock can not be cleared. It is held by someone else.";} else { echo "Lock successfully set/cleared";}