Linux, fcntl, F_SETLEASE and signals
mwh at python.net
Wed Jul 21 18:32:31 CEST 2004
Chris Green <cmg at dok.org> writes:
> Hey folks,
> Is there anyway for a signal handler in python to get the information
> from a 3 argument signal handler rather than just the signal number
> and stack frame?
> I've got an application where I have to check for F_SETLEASE on a file
> in python on Linux 2.4. What this does is tells the kernel to notify
> the current process with SIGIO that a particular file descriptor is being
> modified by another process.
> >>> import fcntl
> >>> f = open(".zshrc", "r+")
> >>> fcntl.fcntl(f, fcntl.F_SETLEASE, fcntl.F_WRLCK)
> Now, when another process opens ".zshrc", I get a SIGIO saying
> something happened. The kernel provides the information on what
> descriptor changed in a siginfo_t's si_fd field.
> Is there anyway to get this from python?
What a wonderful interface. I think you'll have to write some C for
<Erwin> I recompiled XFree 4.2 with gcc 3.2-beta-from-cvs with -O42
and -march-pentium4-800Mhz and I am sure that the MOUSE
CURSOR is moving 5 % FASTER!
-- from Twisted.Quotes
More information about the Python-list