Re: [PATCH][PR threads/15824] when get threads name failed from info threads with linux kernel version earlier than 2.6.33

Yao Qi
2013-08-19T03:10:35Z

On 08/19/2013 10:52 AM, Will Huang wrote:
> +
> +/* Return the string length of FILED /proc/LWPID/task/TID/status.
> + Return -1 if not found. */
> +
> +static int
> +linux_proc_get_string (pid_t lwpid, pid_t tid, char *target,
> + size_t t_size, const char *field)

I suggest renaming this function to "linux_proc_parse_status" or
something else, and adjust the comment.

/* Parse file /proc/LWPID/task/TID/status, save the value of FIELD
in buffer TARGET, whose length is T_SIZE, and return the length
of the value. If TID is zero, parse /proc/LWPID/status instead.
Return -1 if not found. */

static int
linux_proc_parse_status (pid_t lwpid, pid_t tid, char *target,
size_t t_size, const char *field)
--
Yao (é½å°§)