From: Enrico Scholz Date: Fri, 16 Jan 2004 18:40:45 +0000 (+0000) Subject: Elseek(), Emkstemp(): added X-Git-Tag: VERSION_0_10~911 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e69b4039c1981d652a8f8cf0927e3446b6258750;p=util-vserver.git Elseek(), Emkstemp(): added Emalloc(), Erealloc(): fixed declarations git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@616 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/src/wrappers.h b/util-vserver/src/wrappers.h index ee8542c..90d598d 100644 --- a/util-vserver/src/wrappers.h +++ b/util-vserver/src/wrappers.h @@ -228,7 +228,7 @@ Edup2(int oldfd, int newfd) return res; } -inline static UNUSED void * +inline static WRAPPER_DECL void * Emalloc(size_t size) { register void *res = malloc(size); @@ -237,7 +237,7 @@ Emalloc(size_t size) } /*@unused@*/ -inline static /*@null@*//*@only@*/ void * +inline static WRAPPER_DECL /*@null@*//*@only@*/ void * Erealloc(/*@only@*//*@out@*//*@null@*/ void *ptr, size_t new_size) /*@ensures maxSet(result) == new_size@*/ @@ -249,6 +249,22 @@ Erealloc(/*@only@*//*@out@*//*@null@*/ void *ptr, return res; } +inline static WRAPPER_DECL off_t +Elseek(int fildes, off_t offset, int whence) +{ + off_t res = lseek(fildes, offset, whence); + FatalErrnoError(res==(off_t)-1, "lseek()"); + return res; +} + +inline static WRAPPER_DECL int +Emkstemp(char *template) +{ + int res = mkstemp(template); + FatalErrnoError(res==-1, "mkstemp()"); + return res; +} + #undef WRAPPER_DECL #endif // H_UTIL_VSERVER_SRC_WRAPPERS_H