the C library should only use bcopy, so programs don't load both!
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 07:40:50 +0000 (23:40 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 07:40:50 +0000 (23:40 -0800)
SCCS-vsn: lib/libc/stdio/fgetln.c 5.2
SCCS-vsn: lib/libc/stdio/fgets.c 5.4
SCCS-vsn: lib/libc/stdio/fread.c 5.4
SCCS-vsn: lib/libc/stdio/fvwrite.c 5.3
SCCS-vsn: lib/libc/stdio/ungetc.c 5.6

usr/src/lib/libc/stdio/fgetln.c
usr/src/lib/libc/stdio/fgets.c
usr/src/lib/libc/stdio/fread.c
usr/src/lib/libc/stdio/fvwrite.c
usr/src/lib/libc/stdio/ungetc.c

index df4ec86..c33837e 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fgetln.c   5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)fgetln.c   5.2 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -103,7 +103,7 @@ fgetline(fp, lenp)
                 */
                if (__slbexpand(fp, len + OPTIMISTIC))
                        goto error;
                 */
                if (__slbexpand(fp, len + OPTIMISTIC))
                        goto error;
-               (void) memcpy((void *)(fp->_lb._base + off), (void *)fp->_p,
+               (void) bcopy((void *)fp->_p, (void *)(fp->_lb._base + off),
                    len - off);
                off = len;
                if (__srefill(fp))
                    len - off);
                off = len;
                if (__srefill(fp))
@@ -117,7 +117,7 @@ fgetline(fp, lenp)
                len += diff;
                if (__slbexpand(fp, len))
                        goto error;
                len += diff;
                if (__slbexpand(fp, len))
                        goto error;
-               (void) memcpy((void *)(fp->_lb._base + off), (void *)fp->_p,
+               (void) bcopy((void *)fp->_p, (void *)(fp->_lb._base + off),
                    diff);
                fp->_r -= diff + 1;
                fp->_p = p + 1;
                    diff);
                fp->_r -= diff + 1;
                fp->_p = p + 1;
index 382876f..fa7ebd3 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fgets.c    5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)fgets.c    5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -63,13 +63,13 @@ fgets(buf, n, fp)
                        len = ++t - p;
                        fp->_r -= len;
                        fp->_p = t;
                        len = ++t - p;
                        fp->_r -= len;
                        fp->_p = t;
-                       (void) memcpy((void *)s, (void *)p, len);
+                       (void) bcopy((void *)p, (void *)s, len);
                        s[len] = 0;
                        return (buf);
                }
                fp->_r -= len;
                fp->_p += len;
                        s[len] = 0;
                        return (buf);
                }
                fp->_r -= len;
                fp->_p += len;
-               (void) memcpy((void *)s, (void *)p, len);
+               (void) bcopy((void *)p, (void *)s, len);
                s += len;
        } while ((n -= len) != 0);
        *s = 0;
                s += len;
        } while ((n -= len) != 0);
        *s = 0;
index 5ece871..2148d8d 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fread.c    5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)fread.c    5.4 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -32,7 +32,7 @@ fread(buf, size, count, fp)
        total = resid;
        p = buf;
        while (resid > (r = fp->_r)) {
        total = resid;
        p = buf;
        while (resid > (r = fp->_r)) {
-               (void) memcpy((void *)p, (void *)fp->_p, (size_t)r);
+               (void) bcopy((void *)fp->_p, (void *)p, (size_t)r);
                fp->_p += r;
                /* fp->_r = 0 ... done in __srefill */
                p += r;
                fp->_p += r;
                /* fp->_r = 0 ... done in __srefill */
                p += r;
@@ -42,7 +42,7 @@ fread(buf, size, count, fp)
                        return ((total - resid) / size);
                }
        }
                        return ((total - resid) / size);
                }
        }
-       (void) memcpy((void *)p, (void *)fp->_p, resid);
+       (void) bcopy((void *)fp->_p, (void *)p, resid);
        fp->_r -= resid;
        fp->_p += resid;
        return (count);
        fp->_r -= resid;
        fp->_p += resid;
        return (count);
index 3a01f28..1b352cc 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fvwrite.c  5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)fvwrite.c  5.3 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -41,7 +41,7 @@ __sfvwrite(fp, uio)
                return (EOF);
 
 #define        MIN(a, b) ((a) < (b) ? (a) : (b))
                return (EOF);
 
 #define        MIN(a, b) ((a) < (b) ? (a) : (b))
-#define        COPY(n)   (void) memcpy((void *)fp->_p, (void *)p, (size_t)(n));
+#define        COPY(n)   (void) bcopy((void *)p, (void *)fp->_p, (size_t)(n));
 
        iov = uio->uio_iov;
        p = iov->iov_base;
 
        iov = uio->uio_iov;
        p = iov->iov_base;
index 210ac77..5b2ef34 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)ungetc.c   5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)ungetc.c   5.6 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -48,7 +48,7 @@ __submore(fp)
        p = realloc(fp->_ub._base, i << 1);
        if (p == NULL)
                return (EOF);
        p = realloc(fp->_ub._base, i << 1);
        if (p == NULL)
                return (EOF);
-       (void) memcpy((void *)(p + i), (void *)p, (size_t)i);
+       (void) bcopy((void *)p, (void *)(p + i), (size_t)i);
        fp->_p = p + i;
        fp->_ub._base = p;
        fp->_ub._size = i << 1;
        fp->_p = p + i;
        fp->_ub._base = p;
        fp->_ub._size = i << 1;