diff options
author | Jim Huang <jserv@0xlab.org> | 2011-12-12 16:17:22 +0800 |
---|---|---|
committer | Jim Huang <jserv@0xlab.org> | 2012-01-14 11:22:36 +0800 |
commit | 28a7c35feac8d73b94f99493534dad069afe5049 (patch) | |
tree | 6c9f36d08271a8870bf1886388bd6c9d1c025bf4 /libc/unistd | |
parent | e30e909363c5c706f394050d9cd00ce222caadbf (diff) | |
download | bionic-28a7c35feac8d73b94f99493534dad069afe5049.zip bionic-28a7c35feac8d73b94f99493534dad069afe5049.tar.gz bionic-28a7c35feac8d73b94f99493534dad069afe5049.tar.bz2 |
execvp: bcopy() is deprecated. Use memcpy() instead
The function bcopy() is marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008. memcpy (POSIX.1-2001) is its recommended replacement.
Change-Id: I2cc0cc4673d1368255afd11132ddbfd3f87b530b
Diffstat (limited to 'libc/unistd')
-rw-r--r-- | libc/unistd/exec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c index a50185f..2fe2a4e 100644 --- a/libc/unistd/exec.c +++ b/libc/unistd/exec.c @@ -195,9 +195,9 @@ execvp(const char *name, char * const *argv) (void)writev(STDERR_FILENO, iov, 3); continue; } - bcopy(p, buf, lp); + memcpy(buf, p, lp); buf[lp] = '/'; - bcopy(name, buf + lp + 1, ln); + memcpy(buf + lp + 1, name, ln); buf[lp + ln + 1] = '\0'; retry: (void)execve(bp, argv, environ); @@ -217,7 +217,7 @@ retry: (void)execve(bp, argv, environ); goto done; memp[0] = "sh"; memp[1] = bp; - bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); + memcpy(memp + 2, argv + 1, cnt * sizeof(char *)); (void)execve(_PATH_BSHELL, memp, environ); goto done; case ENOMEM: |