diff options
Diffstat (limited to 'usr/src/lib/libproc/common/Plwpregs.c')
-rw-r--r-- | usr/src/lib/libproc/common/Plwpregs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/lib/libproc/common/Plwpregs.c b/usr/src/lib/libproc/common/Plwpregs.c index bb16b50370..76f658a458 100644 --- a/usr/src/lib/libproc/common/Plwpregs.c +++ b/usr/src/lib/libproc/common/Plwpregs.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -30,6 +29,7 @@ #include <sys/uio.h> #include <string.h> #include <errno.h> +#include <limits.h> #include "Pcontrol.h" #include "P32ton.h" @@ -68,11 +68,11 @@ static int getlwpfile(struct ps_prochandle *P, lwpid_t lwpid, const char *fbase, void *rp, size_t n) { - char fname[64]; + char fname[PATH_MAX]; int fd; - (void) snprintf(fname, sizeof (fname), "/proc/%d/lwp/%d/%s", - (int)P->status.pr_pid, (int)lwpid, fbase); + (void) snprintf(fname, sizeof (fname), "%s/%d/lwp/%d/%s", + procfs_path, (int)P->status.pr_pid, (int)lwpid, fbase); if ((fd = open(fname, O_RDONLY)) >= 0) { if (read(fd, rp, n) > 0) { @@ -133,7 +133,7 @@ setlwpregs(struct ps_prochandle *P, lwpid_t lwpid, long cmd, const void *rp, size_t n) { iovec_t iov[2]; - char fname[64]; + char fname[PATH_MAX]; int fd; if (P->state != PS_STOP) { @@ -170,8 +170,8 @@ setlwpregs(struct ps_prochandle *P, lwpid_t lwpid, long cmd, * If the lwp we want is not the representative lwp, we need to * open the ctl file for that specific lwp. */ - (void) snprintf(fname, sizeof (fname), "/proc/%d/lwp/%d/lwpctl", - (int)P->status.pr_pid, (int)lwpid); + (void) snprintf(fname, sizeof (fname), "%s/%d/lwp/%d/lwpctl", + procfs_path, (int)P->status.pr_pid, (int)lwpid); if ((fd = open(fname, O_WRONLY)) >= 0) { if (writev(fd, iov, 2) > 0) { |