chiark / gitweb /
Regenerated formatted documentation (spec.ps, spec.html).
[userv.git] / lib.c
diff --git a/lib.c b/lib.c
index 7a22d19eae1e96a29dd9214447f33e1024b8418b..22c8cd1750a52af1855b242104191d6abb3028a1 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -25,6 +25,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
+#include <assert.h>
 #include <sys/types.h>
 
 #include "config.h"
@@ -112,3 +113,15 @@ void snytprintfcat(char *buffer, size_t size, const char *fmt, ...) {
   vsnytprintfcat(buffer,size,fmt,al);
   va_end(al);
 }
+
+#ifndef HAVE_SETENV
+int setenv(const char *name, const char *value, int overwrite) {
+  char *buffer= 0;
+  
+  assert(overwrite==1);
+  buffer= xmalloc(strlen(name)+strlen(value)+2);
+
+  sprintf(buffer,"%s=%s",name,value);
+  return putenv(buffer);
+}
+#endif /* HAVE_SETENV */