Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2013 12:09:20 GMT
From:      Petr Salinger <>
Subject:   threads/180652: compat32 problem in clock_getcpuclockid2
Message-ID:  <>
Resent-Message-ID: <>

Next in thread | Raw E-Mail | Index | Archive | Help

>Number:         180652
>Category:       threads
>Synopsis:       compat32 problem in clock_getcpuclockid2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-threads
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 19 12:10:00 UTC 2013
>Originator:     Petr Salinger
>Release:        HEAD
GNU/kFreeBSD 10.0-0-amd64
The prototype is

int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id);

In the first argument so far only pid_t and lwpid_t sizes are passed.

Accroding to sys/_types.h:

typedef __int64_t       __id_t;
typedef __int32_t       __lwpid_t; 
typedef __int32_t       __pid_t;
typedef __int32_t       __clockid_t;

There is no freebsd32_clock_getcpuclockid2 at all.
The 64-bit argument is misplaced in compat32.



The PID/TID is encoded in lower 30 bits of clockid.
I.e. whole id_t space cannot be used anyway.

Please either change signature of syscall to

int clock_getcpuclockid2(long id, int which, clockid_t *clock_id);

or provide real

freebsd32_clock_getcpuclockid2 ();


Want to link to this message? Use this URL: <>