libeatmydata is a small LD_PRELOAD library designed to (transparently) disable

fsync (and friends, like open(O_SYNC)). This has two side-effects: making
software that writes data safely to disk a lot quicker and making this
software no longer crash safe.

DO NOT use libeatmydata on software where you care about what it
stores. It's called libEAT-MY-DATA for a reason.

PR:		ports/142892
Submitted by:	Attila Nagy <bra at fsn.hu>
This commit is contained in:
Philip M. Gollucci 2010-02-11 20:59:20 +00:00
parent 9cf69f0222
commit 90d8d127ca
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=249616
6 changed files with 76 additions and 0 deletions

View file

@ -331,6 +331,7 @@
SUBDIR += lc
SUBDIR += ldconfig_compat
SUBDIR += lesspipe
SUBDIR += libeatmydata
SUBDIR += libhome
SUBDIR += libmcal
SUBDIR += libmetalink

View file

@ -0,0 +1,31 @@
# New ports collection makefile for: libeatmydata
# Date created: Sat Jan 16 20:41:35 CET 2010
# Whom: Attila Nagy <bra@fsn.hu>
#
# $FreeBSD$
#
PORTNAME= libeatmydata
PORTVERSION= 9
CATEGORIES= misc
MASTER_SITES= http://www.flamingspork.com/projects/libeatmydata/
MAINTAINER= bra@fsn.hu
COMMENT= a small LD_PRELOAD library designed to (transparently) disable fsync
USE_BZIP2= yes
NO_MTREE= yes
USE_LDCONFIG= yes
PLIST_FILES= lib/libeatmydata.so \
lib/libeatmydata.so.1 \
lib/libeatmydata.so.1.0
do-install:
${INSTALL_DATA} ${WRKSRC}/libeatmydata.so.1.0 ${PREFIX}/lib
post-install:
${LN} ${PREFIX}/lib/libeatmydata.so.1.0 ${PREFIX}/lib/libeatmydata.so.1
${LN} ${PREFIX}/lib/libeatmydata.so.1.0 ${PREFIX}/lib/libeatmydata.so
.include <bsd.port.mk>

View file

@ -0,0 +1,3 @@
MD5 (libeatmydata-9.tar.bz2) = 61456c6939acd227deeee9ec471514ef
SHA256 (libeatmydata-9.tar.bz2) = 9dc1fcc14e77fe354e9561c9b19a6c2eb9ba0b305c63651b1a35d004f797cf08
SIZE (libeatmydata-9.tar.bz2) = 12130

View file

@ -0,0 +1,15 @@
--- Makefile.orig 2010-01-16 20:34:10.000000000 +0100
+++ Makefile 2010-01-16 20:38:43.000000000 +0100
@@ -1,10 +1,10 @@
-all: libs fsynctest
+all: libs
clean:
rm -f libeatmydata.so* fsynctest
libs: eatmydata.c
- gcc -shared -Wl,-soname,libeatmydata.so.1 -ldl -o libeatmydata.so.1.0 eatmydata.c -fPIC
+ gcc -shared -Wl,-soname,libeatmydata.so.1 -o libeatmydata.so.1.0 eatmydata.c -fPIC
@rm -f libeatmydata.so.1 libeatmydata.so
ln -s libeatmydata.so.1.0 libeatmydata.so.1
ln -s libeatmydata.so.1 libeatmydata.so

View file

@ -0,0 +1,19 @@
--- eatmydata.c.orig 2009-05-12 03:11:01.000000000 +0200
+++ eatmydata.c 2010-01-16 20:33:45.000000000 +0100
@@ -53,10 +53,15 @@
mode_t mode;
va_start(ap, flags);
- mode= va_arg(ap, mode_t);
+ mode= va_arg(ap, int);
va_end(ap);
+#if defined(O_DSYNC)
flags &= ~(O_SYNC|O_DSYNC);
+#else
+ flags &= ~(O_SYNC);
+#endif
+
if(!libc_open)
eatmydata_init();

View file

@ -0,0 +1,7 @@
libeatmydata is a small LD_PRELOAD library designed to (transparently) disable
fsync (and friends, like open(O_SYNC)). This has two side-effects: making
software that writes data safely to disk a lot quicker and making this
software no longer crash safe.
DO NOT use libeatmydata on software where you care about what it
stores. It's called libEAT-MY-DATA for a reason.