Trying to get this POSIX I/O code to work on our machines.

Running it from a NFS v3 mounted scratch sapce, with 'noac' option: no
caching attribute option.
It fails to run: gives me err= -1 and errno = 5

Although this works without error on my NFS v3 mounted home
directories. Which are mounted from the head node of our cluster(Linux
based head node and compute nodes).
Where as the scratch sapce is mounted of our storage server(Solaris).

Any idea ?
~thanks - al

#include
#include
#include

main()
{
struct flock lock;
int fd, err;

lock.l_type = F_WRLCK;
lock.l_start = 0;
lock.l_whence = SEEK_SET;
lock.l_len = 100;

fd = open("test", O_RDWR | O_CREAT, 0644);

err = fcntl(fd, F_SETLKW, &lock);

printf("err = %d, errno = %d\n", err, errno);
close(fd);
}