Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2013 12:09:20 GMT
From:      Petr Salinger <Petr.Salinger@seznam.cz>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   threads/180652: compat32 problem in clock_getcpuclockid2
Message-ID:  <201307191209.r6JC9KUQ001513@oldred.freebsd.org>
Resent-Message-ID: <201307191210.r6JCA07G064412@freefall.freebsd.org>

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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 19 12:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Petr Salinger
>Release:        HEAD
>Organization:
>Environment:
GNU/kFreeBSD 10.0-0-amd64
>Description:
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.


>How-To-Repeat:

>Fix:

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 ();


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307191209.r6JC9KUQ001513>