Re: [PATCH v2] gdb/remote: Remove negative tid/pid handling in wite_ptid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 11/6/19 1:27 PM, Evgeniy Didin wrote:
> Actually thread and process ID's are positive values. Accorting to
> threads are creating using "clone" syscall, so the ID generation mechanism
> is similar for threads and processes. According to Linux source code
> there is a function call tree, which allocates  PID[TID]:
> clone
>  |->_do_fork
>     |->copy_process
>       |->alloc_pid
>         |->idr_alloc_cyclic
>           |->idr_alloc_u32(idr, ptr, &id, max, gfp);
> And in idr_alloc_u32() "id" is u32 value, which means positiveness.
> Also according to:
> PID cannot be less than 1.

Sure for Linux.  But negative numbers have meaning in the remote protocol:

Pedro Alves

linux-snps-arc mailing list

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux