cleanups; moved structure declarations from vunify.c into this headerfile
[util-vserver.git] / util-vserver / src / wrappers.h
index ee8542c..90d598d 100644 (file)
@@ -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