From 1cc063a7808d126341d8196d5b51085b1a2c1df4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 11 Mar 1992 02:34:24 +0000 Subject: [PATCH] entered into RCS --- sysdeps/unix/bsd/vax/brk.S | 21 ++++++++++++++------- sysdeps/vax/memccpy.c | 12 ++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/sysdeps/unix/bsd/vax/brk.S b/sysdeps/unix/bsd/vax/brk.S index eb583a4d1d..9186d863b6 100644 --- a/sysdeps/unix/bsd/vax/brk.S +++ b/sysdeps/unix/bsd/vax/brk.S @@ -22,17 +22,24 @@ Cambridge, MA 02139, USA. */ #define SYS_brk 17 #endif +#ifndef HAVE_GNU_LD +#define __end _end +#endif + .data .globl ___curbrk ___curbrk: -#ifdef __GNU_STAB__ - .long ___end -#else - .long _end -#endif + .long __end .text -SYSCALL__ (brk) - movl r0, ___curbrk +ENTRY (__brk) + cmpl 4(ap), __end + bgeq 0f + movl __env, 4(ap) +0: chmk $SYS_brk + bcs 1f + movl 4(ap), ___curbrk clrl r0 ret +1: + jmp syscall_error diff --git a/sysdeps/vax/memccpy.c b/sysdeps/vax/memccpy.c index ca01fb32a8..84df894c3f 100644 --- a/sysdeps/vax/memccpy.c +++ b/sysdeps/vax/memccpy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,22 +22,22 @@ Cambridge, MA 02139, USA. */ /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, - or NULL if C was not found in the first NBYTES bytes of SRC. */ + or NULL if C was not found in the first N bytes of SRC. */ PTR DEFUN(__memccpy, (dest, src, c, n), PTR dest AND CONST PTR src AND int c AND size_t nbytes) { - /* Except when NBYTES > 65535, this is what a hand-coded version would + /* Except when N > 65535, this is what a hand-coded version would do anyway. */ - PTR found = memchr(src, c, n); + PTR found = memchr (src, c, n); if (found == NULL) { - (void) memcpy(dest, src, n); + (void) memcpy (dest, src, n); return NULL; } - (void) memcpy(dest, src, (char *) found + 1 - (char *) src); + (void) memcpy (dest, src, (char *) found + 1 - (char *) src); return (PTR) ((char *) dest + ((char *) found + 1 - (char *) src)); }