mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: boi@boi.at, linux-kernel@vger.kernel.org
Subject: Re: blocking file lock functions (lockf,flock,fcntl) do not return after timer signal
Date: Wed, 12 Oct 2005 12:36:47 -0400	[thread overview]
Message-ID: <1129135007.8434.19.camel@lade.trondhjem.org> (raw)
In-Reply-To: <81b0412b0510120810o6d06a678q1d4a9787687b9bfa@mail.gmail.com>

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


      parent reply	other threads:[~2005-10-12 16:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-12  7:54 "Dieter Müller (BOI GmbH)"
2005-10-12 12:48 ` Alex Riesen
2005-10-12 13:09   ` linux-os (Dick Johnson)
2005-10-12 14:39   ` Trond Myklebust
2005-10-12 15:10     ` Alex Riesen
2005-10-12 15:20       ` linux-os (Dick Johnson)
2005-10-12 15:37         ` Michael Kerrisk
2005-10-12 15:43           ` linux-os (Dick Johnson)
2005-10-12 16:05             ` Michael Kerrisk
2005-10-12 16:06             ` Mark Lord
2005-10-12 21:15         ` Alex Riesen
2005-10-12 16:36       ` Trond Myklebust [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1129135007.8434.19.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=boi@boi.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®