Package: laptop-mode
Severity: wishlist

Hi !

Some programs, like emacs, call fsync() syscall just after saving a
file. When running on battery, this wakes up the hard
disk. laptop-mode should provide an option to avoid this behavior.

Currently, I have written a very simple lib called libnofsync.so and
which simplies redefines the function fsync() to return 0 (it should
be compiled with -fPIC). I put it in /lib and setgid it (because, it
should work on setuid programs). I run ldconfig -v.

Then, I create /etc/ld.so.preload which contains "/lib/libnofsync.so"

Now, each application which is trying to call fsync() syscall will in
fact call the modified one which does nothing. When on AC,
ld.so.preload could be removed (or reverted to the original
version). Or we could use something like what is done with syslog.

Putting libnofsync.so in /lib is very important. If it was in
/usr/lib, and /usr was mounted separetely, init could be unable to
run !

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10-zoro.2
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Reply via email to