Browse Source

Add framework for resolving (pun intended) libc namespace issues, using

wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT.  Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h.  Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.
tests clean on i386, amd64, sparc64, powerpc, and mips64
naming feedback from kettenis@ and millert@
ok kettenis@
OPENBSD_5_9
guenther 9 years ago
parent
commit
3e2a03de0a
43 changed files with 85 additions and 69 deletions
  1. +1
    -29
      src/include/err.h
  2. +2
    -1
      src/lib/libc/string/bcmp.c
  3. +2
    -1
      src/lib/libc/string/bcopy.c
  4. +2
    -1
      src/lib/libc/string/bzero.c
  5. +2
    -1
      src/lib/libc/string/explicit_bzero.c
  6. +2
    -1
      src/lib/libc/string/ffs.c
  7. +2
    -1
      src/lib/libc/string/memccpy.c
  8. +2
    -1
      src/lib/libc/string/memchr.c
  9. +2
    -1
      src/lib/libc/string/memcmp.c
  10. +2
    -1
      src/lib/libc/string/memcpy.c
  11. +2
    -1
      src/lib/libc/string/memmem.c
  12. +2
    -1
      src/lib/libc/string/memmove.c
  13. +2
    -1
      src/lib/libc/string/memrchr.c
  14. +2
    -1
      src/lib/libc/string/memset.c
  15. +2
    -1
      src/lib/libc/string/stpncpy.c
  16. +3
    -1
      src/lib/libc/string/strcasecmp.c
  17. +2
    -1
      src/lib/libc/string/strcasestr.c
  18. +2
    -1
      src/lib/libc/string/strchr.c
  19. +2
    -1
      src/lib/libc/string/strcmp.c
  20. +2
    -1
      src/lib/libc/string/strcoll.c
  21. +2
    -1
      src/lib/libc/string/strcspn.c
  22. +2
    -1
      src/lib/libc/string/strdup.c
  23. +2
    -1
      src/lib/libc/string/strerror.c
  24. +2
    -1
      src/lib/libc/string/strerror_r.c
  25. +2
    -1
      src/lib/libc/string/strlcat.c
  26. +2
    -1
      src/lib/libc/string/strlcpy.c
  27. +2
    -1
      src/lib/libc/string/strlen.c
  28. +2
    -1
      src/lib/libc/string/strmode.c
  29. +2
    -1
      src/lib/libc/string/strncat.c
  30. +2
    -1
      src/lib/libc/string/strncmp.c
  31. +2
    -1
      src/lib/libc/string/strncpy.c
  32. +2
    -1
      src/lib/libc/string/strndup.c
  33. +2
    -1
      src/lib/libc/string/strnlen.c
  34. +2
    -1
      src/lib/libc/string/strpbrk.c
  35. +2
    -1
      src/lib/libc/string/strrchr.c
  36. +2
    -1
      src/lib/libc/string/strsep.c
  37. +1
    -0
      src/lib/libc/string/strsignal.c
  38. +2
    -1
      src/lib/libc/string/strspn.c
  39. +2
    -1
      src/lib/libc/string/strstr.c
  40. +2
    -0
      src/lib/libc/string/strtok.c
  41. +2
    -1
      src/lib/libc/string/strxfrm.c
  42. +2
    -1
      src/lib/libc/string/timingsafe_bcmp.c
  43. +2
    -1
      src/lib/libc/string/timingsafe_memcmp.c

+ 1
- 29
src/include/err.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: err.h,v 1.12 2014/04/22 00:33:02 guenther Exp $ */
/* $OpenBSD: err.h,v 1.13 2015/08/31 02:53:56 guenther Exp $ */
/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ /* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */
/*- /*-
@ -65,34 +65,6 @@ void warnx(const char *, ...)
void vwarnx(const char *, __va_list) void vwarnx(const char *, __va_list)
__attribute__((__format__ (printf, 1, 0))); __attribute__((__format__ (printf, 1, 0)));
/*
* The _* versions are for use inside libc only and will go away
*/
__dead void _err(int, const char *, ...)
__attribute__((__format__ (printf, 2, 3)));
__dead void _verr(int, const char *, __va_list)
__attribute__((__format__ (printf, 2, 0)));
__dead void _errc(int, int, const char *, ...)
__attribute__((__format__ (printf, 3, 4)));
__dead void _verrc(int, int, const char *, __va_list)
__attribute__((__format__ (printf, 3, 0)));
__dead void _errx(int, const char *, ...)
__attribute__((__format__ (printf, 2, 3)));
__dead void _verrx(int, const char *, __va_list)
__attribute__((__format__ (printf, 2, 0)));
void _warn(const char *, ...)
__attribute__((__format__ (printf, 1, 2)));
void _vwarn(const char *, __va_list)
__attribute__((__format__ (printf, 1, 0)));
void _warnc(int, const char *, ...)
__attribute__((__format__ (printf, 2, 3)));
void _vwarnc(int, const char *, __va_list)
__attribute__((__format__ (printf, 2, 0)));
void _warnx(const char *, ...)
__attribute__((__format__ (printf, 1, 2)));
void _vwarnx(const char *, __va_list)
__attribute__((__format__ (printf, 1, 0)));
__END_DECLS __END_DECLS
#endif /* !_ERR_H_ */ #endif /* !_ERR_H_ */

+ 2
- 1
src/lib/libc/string/bcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: bcmp.c,v 1.10 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: bcmp.c,v 1.11 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1987 Regents of the University of California. * Copyright (c) 1987 Regents of the University of California.
@ -49,3 +49,4 @@ bcmp(const void *b1, const void *b2, size_t length)
while (--length); while (--length);
return (0); return (0);
} }
DEF_WEAK(bcmp);

+ 2
- 1
src/lib/libc/string/bcopy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: bcopy.c,v 1.6 2014/11/30 19:43:56 deraadt Exp $ */
/* $OpenBSD: bcopy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -110,3 +110,4 @@ bcopy(const void *src0, void *dst0, size_t length)
done: done:
return; return;
} }
DEF_WEAK(bcopy);

+ 2
- 1
src/lib/libc/string/bzero.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: bzero.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: bzero.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1987 Regents of the University of California. * Copyright (c) 1987 Regents of the University of California.
@ -42,3 +42,4 @@ bzero(void *b, size_t length)
for (p = b; length--;) for (p = b; length--;)
*p++ = '\0'; *p++ = '\0';
} }
DEF_WEAK(bzero);

+ 2
- 1
src/lib/libc/string/explicit_bzero.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */
/* $OpenBSD: explicit_bzero.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Public domain. * Public domain.
* Written by Matthew Dempsky. * Written by Matthew Dempsky.
@ -17,3 +17,4 @@ explicit_bzero(void *buf, size_t len)
memset(buf, 0, len); memset(buf, 0, len);
__explicit_bzero_hook(buf, len); __explicit_bzero_hook(buf, len);
} }
DEF_WEAK(explicit_bzero);

+ 2
- 1
src/lib/libc/string/ffs.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ffs.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: ffs.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Public domain. * Public domain.
@ -38,3 +38,4 @@ ffs(int mask)
return (bit + t[ r & 0xf ]); return (bit + t[ r & 0xf ]);
} }
DEF_WEAK(ffs);

+ 2
- 1
src/lib/libc/string/memccpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memccpy.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: memccpy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -46,3 +46,4 @@ memccpy(void *t, const void *f, int c, size_t n)
} }
return (0); return (0);
} }
DEF_WEAK(memccpy);

+ 2
- 1
src/lib/libc/string/memchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memchr.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: memchr.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -46,3 +46,4 @@ memchr(const void *s, int c, size_t n)
} }
return (NULL); return (NULL);
} }
DEF_STRONG(memchr);

+ 2
- 1
src/lib/libc/string/memcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memcmp.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: memcmp.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -49,3 +49,4 @@ memcmp(const void *s1, const void *s2, size_t n)
} }
return (0); return (0);
} }
DEF_STRONG(memcmp);

+ 2
- 1
src/lib/libc/string/memcpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memcpy.c,v 1.1 2014/11/30 19:43:56 deraadt Exp $ */
/* $OpenBSD: memcpy.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -97,3 +97,4 @@ memcpy(void *dst0, const void *src0, size_t length)
done: done:
return (dst0); return (dst0);
} }
DEF_STRONG(memcpy);

+ 2
- 1
src/lib/libc/string/memmem.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memmem.c,v 1.3 2013/05/30 01:10:45 ajacoutot Exp $ */
/* $OpenBSD: memmem.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com> * Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
* *
@ -61,3 +61,4 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
return NULL; return NULL;
} }
DEF_WEAK(memmem);

+ 2
- 1
src/lib/libc/string/memmove.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memmove.c,v 1.1 2014/11/30 19:43:56 deraadt Exp $ */
/* $OpenBSD: memmove.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -110,3 +110,4 @@ memmove(void *dst0, const void *src0, size_t length)
done: done:
return (dst0); return (dst0);
} }
DEF_STRONG(memmove);

+ 2
- 1
src/lib/libc/string/memrchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memrchr.c,v 1.2 2007/11/27 16:22:12 martynas Exp $ */
/* $OpenBSD: memrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com>
@ -36,3 +36,4 @@ memrchr(const void *s, int c, size_t n)
} }
return(NULL); return(NULL);
} }
DEF_WEAK(memrchr);

+ 2
- 1
src/lib/libc/string/memset.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: memset.c,v 1.6 2008/03/15 21:40:39 ray Exp $ */
/* $OpenBSD: memset.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -45,3 +45,4 @@ memset(void *dst, int c, size_t n)
} }
return (dst); return (dst);
} }
DEF_STRONG(memset);

+ 2
- 1
src/lib/libc/string/stpncpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: stpncpy.c,v 1.2 2012/07/11 10:44:59 naddy Exp $ */
/* $OpenBSD: stpncpy.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -54,3 +54,4 @@ stpncpy(char *dst, const char *src, size_t n)
} }
return (dst); return (dst);
} }
DEF_WEAK(stpncpy);

+ 3
- 1
src/lib/libc/string/strcasecmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strcasecmp.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1987, 1993 * Copyright (c) 1987, 1993
@ -85,6 +85,7 @@ strcasecmp(const char *s1, const char *s2)
return (0); return (0);
return (cm[*us1] - cm[*--us2]); return (cm[*us1] - cm[*--us2]);
} }
DEF_WEAK(strcasecmp);
int int
strncasecmp(const char *s1, const char *s2, size_t n) strncasecmp(const char *s1, const char *s2, size_t n)
@ -103,3 +104,4 @@ strncasecmp(const char *s1, const char *s2, size_t n)
} }
return (0); return (0);
} }
DEF_WEAK(strncasecmp);

+ 2
- 1
src/lib/libc/string/strcasestr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcasestr.c,v 1.3 2006/03/31 05:34:55 deraadt Exp $ */
/* $OpenBSD: strcasestr.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: strcasestr.c,v 1.2 2005/02/09 21:35:47 kleink Exp $ */ /* $NetBSD: strcasestr.c,v 1.2 2005/02/09 21:35:47 kleink Exp $ */
/*- /*-
@ -58,3 +58,4 @@ strcasestr(const char *s, const char *find)
} }
return ((char *)s); return ((char *)s);
} }
DEF_WEAK(strcasestr);

+ 2
- 1
src/lib/libc/string/strchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strchr.c,v 1.2 2015/05/15 22:29:37 millert Exp $ */
/* $OpenBSD: strchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -43,3 +43,4 @@ strchr(const char *p, int ch)
} }
/* NOTREACHED */ /* NOTREACHED */
} }
DEF_STRONG(strchr);

+ 2
- 1
src/lib/libc/string/strcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: strcmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -45,3 +45,4 @@ strcmp(const char *s1, const char *s2)
return (0); return (0);
return (*(unsigned char *)s1 - *(unsigned char *)--s2); return (*(unsigned char *)s1 - *(unsigned char *)--s2);
} }
DEF_STRONG(strcmp);

+ 2
- 1
src/lib/libc/string/strcoll.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcoll.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strcoll.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -42,3 +42,4 @@ strcoll(const char *s1, const char *s2)
/* LC_COLLATE is unimplemented, hence always "C" */ /* LC_COLLATE is unimplemented, hence always "C" */
return (strcmp(s1, s2)); return (strcmp(s1, s2));
} }
DEF_STRONG(strcoll);

+ 2
- 1
src/lib/libc/string/strcspn.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strcspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strcspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -56,3 +56,4 @@ strcspn(const char *s1, const char *s2)
} }
/* NOTREACHED */ /* NOTREACHED */
} }
DEF_STRONG(strcspn);

+ 2
- 1
src/lib/libc/string/strdup.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strdup.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strdup.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1988, 1993 * Copyright (c) 1988, 1993
@ -47,3 +47,4 @@ strdup(const char *str)
(void)memcpy(copy, str, siz); (void)memcpy(copy, str, siz);
return(copy); return(copy);
} }
DEF_WEAK(strdup);

+ 2
- 1
src/lib/libc/string/strerror.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strerror.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strerror.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1988 Regents of the University of California. * Copyright (c) 1988 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -39,3 +39,4 @@ strerror(int num)
(void)strerror_r(num, buf, sizeof(buf)); (void)strerror_r(num, buf, sizeof(buf));
return (buf); return (buf);
} }
DEF_STRONG(strerror);

+ 2
- 1
src/lib/libc/string/strerror_r.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strerror_r.c,v 1.8 2013/06/01 21:26:18 stsp Exp $ */
/* $OpenBSD: strerror_r.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/* Public Domain <marc@snafu.org> */ /* Public Domain <marc@snafu.org> */
#ifdef NLS #ifdef NLS
@ -125,6 +125,7 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen)
errno = ret_errno ? ret_errno : save_errno; errno = ret_errno ? ret_errno : save_errno;
return (ret_errno); return (ret_errno);
} }
DEF_WEAK(strerror_r);
#define USIGPREFIX "Unknown signal: " #define USIGPREFIX "Unknown signal: "


+ 2
- 1
src/lib/libc/string/strlcat.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlcat.c,v 1.15 2015/03/02 21:41:08 millert Exp $ */
/* $OpenBSD: strlcat.c,v 1.16 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@ -53,3 +53,4 @@ strlcat(char *dst, const char *src, size_t dsize)
return(dlen + (src - osrc)); /* count does not include NUL */ return(dlen + (src - osrc)); /* count does not include NUL */
} }
DEF_WEAK(strlcat);

+ 2
- 1
src/lib/libc/string/strlcpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */
/* $OpenBSD: strlcpy.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@ -48,3 +48,4 @@ strlcpy(char *dst, const char *src, size_t dsize)
return(src - osrc - 1); /* count does not include NUL */ return(src - osrc - 1); /* count does not include NUL */
} }
DEF_WEAK(strlcpy);

+ 2
- 1
src/lib/libc/string/strlen.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlen.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: strlen.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -41,3 +41,4 @@ strlen(const char *str)
return (s - str); return (s - str);
} }
DEF_STRONG(strlen);

+ 2
- 1
src/lib/libc/string/strmode.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strmode.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strmode.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -138,3 +138,4 @@ strmode(int mode, char *p)
*p++ = ' '; /* will be a '+' if ACL's implemented */ *p++ = ' '; /* will be a '+' if ACL's implemented */
*p = '\0'; *p = '\0';
} }
DEF_WEAK(strmode);

+ 2
- 1
src/lib/libc/string/strncat.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strncat.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strncat.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -55,3 +55,4 @@ strncat(char *dst, const char *src, size_t n)
} }
return (dst); return (dst);
} }
DEF_STRONG(strncat);

+ 2
- 1
src/lib/libc/string/strncmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strncmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: strncmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1989 The Regents of the University of California. * Copyright (c) 1989 The Regents of the University of California.
@ -45,3 +45,4 @@ strncmp(const char *s1, const char *s2, size_t n)
} while (--n != 0); } while (--n != 0);
return (0); return (0);
} }
DEF_STRONG(strncmp);

+ 2
- 1
src/lib/libc/string/strncpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strncpy.c,v 1.7 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: strncpy.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -56,3 +56,4 @@ strncpy(char *dst, const char *src, size_t n)
} }
return (dst); return (dst);
} }
DEF_STRONG(strncpy);

+ 2
- 1
src/lib/libc/string/strndup.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strndup.c,v 1.1 2010/05/18 22:24:55 tedu Exp $ */
/* $OpenBSD: strndup.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@ -37,3 +37,4 @@ strndup(const char *str, size_t maxlen)
return copy; return copy;
} }
DEF_WEAK(strndup);

+ 2
- 1
src/lib/libc/string/strnlen.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strnlen.c,v 1.5 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: strnlen.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@ -30,3 +30,4 @@ strnlen(const char *str, size_t maxlen)
return (size_t)(cp - str); return (size_t)(cp - str);
} }
DEF_WEAK(strnlen);

+ 2
- 1
src/lib/libc/string/strpbrk.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strpbrk.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strpbrk.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1985 Regents of the University of California. * Copyright (c) 1985 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -46,3 +46,4 @@ strpbrk(const char *s1, const char *s2)
} }
return (NULL); return (NULL);
} }
DEF_STRONG(strpbrk);

+ 2
- 1
src/lib/libc/string/strrchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strrchr.c,v 1.2 2015/05/15 22:29:37 millert Exp $ */
/* $OpenBSD: strrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1988 Regents of the University of California. * Copyright (c) 1988 Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -45,3 +45,4 @@ strrchr(const char *p, int ch)
} }
/* NOTREACHED */ /* NOTREACHED */
} }
DEF_STRONG(strrchr);

+ 2
- 1
src/lib/libc/string/strsep.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */
/* $OpenBSD: strsep.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -68,3 +68,4 @@ strsep(char **stringp, const char *delim)
} }
/* NOTREACHED */ /* NOTREACHED */
} }
DEF_WEAK(strsep);

+ 1
- 0
src/lib/libc/string/strsignal.c View File

@ -39,3 +39,4 @@ strsignal(int sig)
return __strsignal(sig, buf); return __strsignal(sig, buf);
} }
DEF_WEAK(strsignal);

+ 2
- 1
src/lib/libc/string/strspn.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 1989 The Regents of the University of California. * Copyright (c) 1989 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -49,3 +49,4 @@ cont:
goto cont; goto cont;
return (p - 1 - s1); return (p - 1 - s1);
} }
DEF_STRONG(strspn);

+ 2
- 1
src/lib/libc/string/strstr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strstr.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strstr.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -54,3 +54,4 @@ strstr(const char *s, const char *find)
} }
return ((char *)s); return ((char *)s);
} }
DEF_STRONG(strstr);

+ 2
- 0
src/lib/libc/string/strtok.c View File

@ -36,6 +36,7 @@ strtok(char *s, const char *delim)
return strtok_r(s, delim, &last); return strtok_r(s, delim, &last);
} }
DEF_STRONG(strtok);
char * char *
strtok_r(char *s, const char *delim, char **last) strtok_r(char *s, const char *delim, char **last)
@ -83,3 +84,4 @@ cont:
} }
/* NOTREACHED */ /* NOTREACHED */
} }
DEF_WEAK(strtok_r);

+ 2
- 1
src/lib/libc/string/strxfrm.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strxfrm.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strxfrm.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -49,3 +49,4 @@ strxfrm(char *dst, const char *src, size_t n)
return (strlen(src)); return (strlen(src));
return (strlcpy(dst, src, n)); return (strlcpy(dst, src, n));
} }
DEF_STRONG(strxfrm);

+ 2
- 1
src/lib/libc/string/timingsafe_bcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: timingsafe_bcmp.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */
/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 2010 Damien Miller. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved.
* *
@ -27,3 +27,4 @@ timingsafe_bcmp(const void *b1, const void *b2, size_t n)
ret |= *p1++ ^ *p2++; ret |= *p1++ ^ *p2++;
return (ret != 0); return (ret != 0);
} }
DEF_WEAK(timingsafe_bcmp);

+ 2
- 1
src/lib/libc/string/timingsafe_memcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: timingsafe_memcmp.c,v 1.1 2014/06/13 02:12:17 matthew Exp $ */
/* $OpenBSD: timingsafe_memcmp.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/* /*
* Copyright (c) 2014 Google Inc. * Copyright (c) 2014 Google Inc.
* *
@ -44,3 +44,4 @@ timingsafe_memcmp(const void *b1, const void *b2, size_t len)
return (res); return (res);
} }
DEF_WEAK(timingsafe_memcmp);

Loading…
Cancel
Save