00001 /* 00002 ** libnosync.so -- library to disable sync/fsync/fdatasync 00003 ** Copyright (c)2002 Aaron Hopkins <tools@die.net> 00004 ** All Rights Reserved. 00005 ** 00006 ** This can be used to speed SMTP servers up greatly on mailservers where data 00007 ** integrity in the face of system crashes is unnecessary while speed is. 00008 ** 00009 ** This program is free software; you can redistribute it and/or modify 00010 ** it under the terms of the GNU General Public License as published by 00011 ** the Free Software Foundation; either version 2 of the License, or 00012 ** (at your option) any later version. 00013 ** 00014 ** This program is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 ** GNU General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU General Public License 00020 ** along with this program; if not, write to the Free Software 00021 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00022 ** 00023 ** Compile with: 00024 ** gcc -O2 -s -Wall -fPIC -shared -o libnosync.so libnosync.c 00025 ** 00026 ** With bash: export LD_PRELOAD=/path/to/libnosync.so 00027 ** 00028 ** With tcsh: setenv LD_PRELOAD /path/to/libnosync.so 00029 ** 00030 */ 00031 00032 #include <unistd.h> 00033 00034 00035 void 00036 sync (void) { 00037 } 00038 00039 00040 int 00041 fsync (int fd) { 00042 return 0; 00043 } 00044 00045 00046 int 00047 fdatasync (int fd) { 00048 return 0; 00049 }