sys/proc.h inclusion of sys/time.h
Jilles Tjoelker
jilles at stack.nl
Tue Jul 8 21:07:31 UTC 2014
On Tue, Jul 08, 2014 at 03:06:33PM -0500, Bryan Drewery wrote:
> In r34924 sys/proc.h was changed to only include sys/time.h if not
> building in kernel.
> [snip]
> (Why am I doing this? I need PID_MAX and NO_PID for a tcpdump change I
> am testing that is intended for upstreaming. Perhaps I can use
> kern.pid_max in __FreeBSD__ and other hacks on other platforms, I have
> not yet decided on this.)
The kern.pid_max sysctl is mostly intended for running FreeBSD 1.0
binaries, which have a 16-bit pid_t. Therefore, it is run-time
adjustable and existing processes may have a pid higher than its value.
Ideally, you do not need PID_MAX and NO_PID; try to use a variable of
type pid_t only for a process ID and store flags elsewhere. There may be
a problem if you need to read pid_t from an internal structure or
message, though.
--
Jilles Tjoelker
More information about the freebsd-arch
mailing list