Skip to content
Snippets Groups Projects
Commit 87dd54d8 authored by rswindell's avatar rswindell
Browse files

Test multiple locks of same region from same process/thread.

parent 986e4c6f
No related branches found
No related tags found
No related merge requests found
......@@ -91,10 +91,14 @@ int main()
return(errno);
}
write(fd,"lock testing\n",LOCK_LEN);
if(lock(fd,LOCK_OFFSET,LOCK_LEN))
if(lock(fd,LOCK_OFFSET,LOCK_LEN)==0)
printf("lock() succeeds\n");
else
printf("!FAILURE lock() non-functional (or file already locked)\n");
if(lock(fd,LOCK_OFFSET,LOCK_LEN)==0)
printf("Subsequent lock succeeded\n");
else
printf("lock() succeeds\n");
perror("!Subsequent lock of "LOCK_FNAME);
if(_beginthread(
lock_test_thread /* entry point */
,0 /* stack size (0=auto) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment