lkml.org 
[lkml]   [2005]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: blocking file lock functions (lockf,flock,fcntl) do not return after timer signal
From
Date
on den 12.10.2005 Klokka 17:10 (+0200) skreiv Alex Riesen:

> > Desktop$ ./gnurr gnarg
> > locking...
> > timeout
> > timeout
> > timeout
> > timeout
> > timeout
>
> Doesn't look so. I'd expect "flock: EWOULDBLOCK" and "sleeping" after
> the first timeout.

I would rather expect flock to return with ERESTARTSYS and then for libc
to restart the syscall once the signal handler has finished executing.
A stint with the "strace" utility will show you that this is precisely
what happens.

As Dick and others already pointed out to you, the POSIX function
sigaction() allows you to disable the automatic restarting of the
syscall.

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-12 18:40    [W:0.060 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site