summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewt <devnull@localhost>1997-05-07 15:09:39 +0000
committerewt <devnull@localhost>1997-05-07 15:09:39 +0000
commit67c8991eb0560035783f1e44ce6b757c61509ec4 (patch)
treefb17bb92d682f99cb5157cde99d289e53bfcdcfe
parent9c2a152c85f5c6b97f25ac4b0b355d6a816fe967 (diff)
downloadlibrpm-tizen-67c8991eb0560035783f1e44ce6b757c61509ec4.tar.gz
librpm-tizen-67c8991eb0560035783f1e44ce6b757c61509ec4.tar.bz2
librpm-tizen-67c8991eb0560035783f1e44ce6b757c61509ec4.zip
*** empty log message ***
CVS patchset: 1608 CVS date: 1997/05/07 15:09:39
-rw-r--r--misc/strerror.c22
-rw-r--r--myrealloc.c12
2 files changed, 34 insertions, 0 deletions
diff --git a/misc/strerror.c b/misc/strerror.c
new file mode 100644
index 000000000..acb81618c
--- /dev/null
+++ b/misc/strerror.c
@@ -0,0 +1,22 @@
+#include<stdlib.h>
+#include<errno.h>
+#include<stdio.h>
+
+extern int sys_nerr;
+extern char *sys_errlist[];
+static char buf[64];
+char * strerror(int errnum)
+
+{
+ if (errnum < 0 || errnum > sys_nerr)
+ {
+ static char fmt[] = "Unknown error %d";
+ size_t len = (size_t) sprintf (buf, fmt, errnum);
+ if (len < (size_t) sizeof(fmt) - 2)
+ return NULL;
+ buf[len - 1] = '\0';
+ return buf;
+ }
+
+ return (char *) sys_errlist[errnum];
+}
diff --git a/myrealloc.c b/myrealloc.c
new file mode 100644
index 000000000..d646d6560
--- /dev/null
+++ b/myrealloc.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+#include <malloc.h>
+#define size_t unsigned
+
+void *myrealloc(void *ptr, size_t size);
+
+void *myrealloc(void *ptr, size_t size) {
+if (ptr == NULL)
+ return malloc(size);
+ else
+ return realloc(ptr, size);
+}